package util;

import java.util.List;

public class PageUtil {

    //1.页码值  2.显示条数  3.查询结果列表  4.总条数  5.总页数
    private Integer pageIndex;     //页码值
    private Integer pageNumber;    //显示条数
    private List dataList;         //查询结果列表
    private Integer total;         //总条数
    private Integer totalPages;    //总页数


    public PageUtil() {
    }

    public PageUtil(Integer pageIndex, Integer pageNumber) {
        this.pageIndex = pageIndex;
        this.pageNumber = pageNumber;
    }

    public Integer getPageIndex() {
        return pageIndex;
    }

    public void setPageIndex(Integer pageIndex) {
        this.pageIndex = pageIndex;
    }

    public Integer getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(Integer pageSize) {
        this.pageNumber = pageSize;
    }

    public List getDataList() {
        return dataList;
    }

    public void setDataList(List dataList) {
        this.dataList = dataList;
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public Integer getTotalPages() {
        return (total%pageNumber>0)?(total/pageNumber+1):(total/pageNumber);
    }

    public void setTotalPages(Integer totalPages) {
        this.totalPages = totalPages;
    }
}
